<template>
  <div class="register_bg">
    <section v-if="show===1">
      <div class="before"><i></i>dpool.top</div>
      <div class="title">{{$t('header.register')}}</div>
      <div class="row mb">
        <label for="email" v-show="email_move">{{$t('login.email')}}</label>
        <input type="text" autocomplete="off" :placeholder="$t('forget.email_info')" id="email" v-model="email" @keyup.enter="sendCode" v-focus>
        <div class="err" v-if="emailErr"><p>{{emailErrText}}</p></div>
      </div>
      <div class="row">
        <label for="email" v-show="code_move">{{$t('forget.input_code')}}</label>
        <input type="text" autocomplete="off" :placeholder="$t('forget.email_code_info')" id="verificationCode" class="small" v-model="code" maxlength="6" @keyup.enter="next">
        <button class="small fr" @click="sendCode" :disabled="!getcode.v_code_btn">{{getcode.codeStr}}</button>

        <div class="err" v-if="codeErr"><p>{{codeErrText}}</p></div>
      </div>
      <div class="row btn">
        <button @click="next">{{$t('forget.next')}}</button>
      </div>
      <p class="info clearfix">
        <router-link class="fr" to="/login">{{$t('register.existing_account')}}</router-link>
      </p>
    </section>
    <section v-else-if="show===2">
      <div class="before"><i></i>dpool.top</div>
      <div class="title">{{$t('header.register')}}</div>
      <div class="row mt mb">
        <label for="pwd" v-show="pwd_move">{{$t('register.set_pwd')}}</label>
        <input type="password" style="display:none;width:0;height:0;">
        <input type="password" autocomplete="new-password" :placeholder="$t('login.pwd_input')" id="pwd" v-model="password" maxlength="32" v-focus>
        <div class="err" v-if="passwordErr"><p>{{passwordErrText}}</p></div>
      </div>
      <div class="row">
        <label for="pwd2" v-show="regpwd_move">{{$t('register.pwd_input_again')}}</label>
        <input type="password" style="display:none;width:0;height:0;">
        <input type="password" autocomplete="new-password" :placeholder="$t('register.pwd_input_sure')" id="pwd2" v-model="rpwd" @keyup.enter="toRegister">
        <div class="err" v-if="rpwdErr"><p>{{rpwdErrText}}</p></div>
      </div>
      <div class="row btn">
        <button @click="toRegister">{{$t('header.register')}}</button>
      </div>
    </section>
    <section v-else class="success">
      <div class="before"><i></i>dpool.top</div>
      <div class="succ">
        <i class="iconfont icon-chenggong2"></i>
        <p>{{$t('register.success')}}</p>
      </div>
    </section>
  </div>
</template>
<script>

import { register } from '@/mixins';

export default {
  mixins: [register],
};
</script>
<style lang="scss" scoped>
.register_bg{
  width: 100%;
  height: 100%;
  position: relative;
  background: url(../../assets/images/login/beijing.jpg) no-repeat;
  background-size: 100% 100%;
  overflow: hidden;
}
section{
  width: 3.234375rem;
  height: 3.520833rem;
  box-shadow: 0px 0px .026042rem 0px rgba(0, 0, 0, 0.05);
  border-radius: .052083rem;
  background-color: #ffffff;
  margin: 0 auto;
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  .before{
    margin: 0 auto .635417rem;
    width: 1.4375rem;
    height: .255208rem;
    line-height: .255208rem;
    display: block;
    background: url(../../assets/images/login/liuhai.png) no-repeat;
    background-size: 100% 100%;
    font-size: .125rem;
    color: #ffffff;
    cursor: pointer;
    position: relative;
    text-align: center;
    padding-left: .197917rem;
    letter-spacing: 1px;
    i{
      position: absolute;
      left: .338542rem;
      top: .0625rem;
      display: block;
      width: .125rem;
      height: .119792rem;
      background: url(../../assets/images/logo/login.png) no-repeat
              center/100% 100%;
    }
  }
  >div{
    margin: 0 auto;
    width: 2.625rem;
    &.title{
      font-size: .125rem;
      color: #73c2b4;
      margin-bottom: 0.1rem;
    }
    &.row{
      position: relative;
      padding-top: .197917rem;
      &.btn{
        padding-top: 0;
      }
      &.mb{
        margin-bottom: .364583rem;
        margin-bottom: .1875rem;
        padding-top: .197917rem;
      }
      label{
        line-height: .197917rem;
        font-size: .104167rem;
        color: #323232;
        font-weight: normal;
        font-stretch: normal;
        position: absolute;
        top: 0;
      }

      input{
        display: block;
        width: 100%;
        height: .177083rem;
        line-height: .177083rem;
        padding-left:.010417rem;
        background-color: #ffffff;
        border: 0;
        border: none;
        border-bottom: 1px solid #e0e0e0;
        outline: none;
        color: #323232;
        font-size: .104167rem;
        font-weight: normal;
        font-stretch: normal;
        &::-webkit-input-placeholder {
          /* WebKit browsers */
          color: #bdbdbd;
          font-size: .083333rem;
        }
        &:-moz-placeholder {
          /* Mozilla Firefox 4 to 18 */
          color: #bdbdbd;
          font-size: .083333rem;
        }
        &::-moz-placeholder {
          /* Mozilla Firefox 19+ */
          color: #bdbdbd;
          font-size: .083333rem;
        }
        &:-ms-input-placeholder {
          /* Internet Explorer 10+ */
          color: #bdbdbd;
          font-size: .083333rem;
        }

      }
      .err{
        position: absolute;
        bottom: -0.208333rem;
        height: .208333rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        color: #eb547c;
        font-size: .072917rem;
        padding-left: .010417rem;
        line-height: .09375rem;
      }
      button{
        width: 2.625rem;
        height: .354167rem;
        margin-top: .463542rem;
        background-image: linear-gradient(90deg, #70c1b3 0%, #b2dbbf 100%),
          linear-gradient(#7a72f9, #7a72f9);
        background-blend-mode: normal, normal;
          font-size: .125rem;
          color: #ffffff;
          border-radius: .026042rem;
        outline: none;
        border: none;
        appearance: none;
        -moz-appearance:none;
        -webkit-appearance:none;
        &.small{
          display: inline-block;
          width: .833333rem;
          height: .166667rem;
          line-height: .166667rem;
          margin-top: 0;
          position: absolute;
          bottom: .015625rem;
          right: 0;
          color: #565656;
          font-size: .104167rem;
          background: transparent;
          border: none;
          background-image: none;
          border-color: #ffffff;
          border-radius: 0;
          outline: none;
          &:disabled{
            background-color: transparent;
          }
          &::before{
            content: ' ';
            width: 1px;
            height: .09375rem;
            background-color: #e0e0e0;
            display: block;
            position: absolute;
            left: 0;
            top: .036458rem;
          }
          &:hover,&:focus{
            background-image: none;
            border-color: transparent;
            background-color: #ffffff;
            outline: none;
          }
        }
        &:hover,&:focus{
          background-color: #8dcdc2;
        }
        &:disabled{
          background-color: #ccc;
          cursor: not-allowed;
        }
      }
    }
  }
  .info{
    margin: .078125rem auto 0;
    width: 2.625rem;
    color: #756a7f;
    font-size: .072917rem;
    line-height: .114583rem;
    a{
      color: #7fafa6;
    }
  }
  &.success{
    text-align: center;
    .succ{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
    }
    i{
      font-size: .625rem;
      color: #70c1b3;
      line-height: .729167rem;
    }
    p{
      font-size: .09375rem;
      color: #333;
    }
  }
}
</style>
